/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.

package com.ccbhelper.tranflows;

import android.content.Context;
import android.content.Intent;

import org.achartengine.GraphicalView;
import org.achartengine.chart.BarChart;
import org.achartengine.chart.BubbleChart;
import org.achartengine.chart.DialChart;
import org.achartengine.chart.DoughnutChart;
import org.achartengine.chart.LineChart;
import org.achartengine.chart.PieChart;
import org.achartengine.chart.RangeBarChart;
import org.achartengine.chart.ScatterChart;
import org.achartengine.chart.TimeChart;
import org.achartengine.model.CategorySeries;
import org.achartengine.model.MultipleCategorySeries;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.renderer.DefaultRenderer;
import org.achartengine.renderer.DialRenderer;
import org.achartengine.renderer.XYMultipleSeriesRenderer;

import com.ccbhelper.activity.GraphicalActivity;

// Referenced classes of package org.achartengine:
//            GraphicalView, GraphicalActivity

public class ChartFactory {

	private ChartFactory() {
	}

	public static final GraphicalView getLineChartView(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		LineChart linechart = new LineChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		return new GraphicalView(context, linechart);
	}

	public static final GraphicalView getScatterChartView(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		ScatterChart scatterchart = new ScatterChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		return new GraphicalView(context, scatterchart);
	}

	public static final GraphicalView getBubbleChartView(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		BubbleChart bubblechart = new BubbleChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		return new GraphicalView(context, bubblechart);
	}

	public static final GraphicalView getTimeChartView(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer, String s) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		TimeChart timechart = new TimeChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		timechart.setDateFormat(s);
		return new GraphicalView(context, timechart);
	}

	public static final GraphicalView getBarChartView(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer,
			org.achartengine.chart.BarChart.Type type) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		BarChart barchart = new BarChart(xymultipleseriesdataset,
				xymultipleseriesrenderer, type);
		return new GraphicalView(context, barchart);
	}

	public static final GraphicalView getRangeBarChartView(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer,
			org.achartengine.chart.BarChart.Type type) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		RangeBarChart rangebarchart = new RangeBarChart(
				xymultipleseriesdataset, xymultipleseriesrenderer, type);
		return new GraphicalView(context, rangebarchart);
	}

	public static final GraphicalView getPieChartView(Context context,
			CategorySeries categoryseries, DefaultRenderer defaultrenderer) {
		checkParameters(categoryseries, defaultrenderer);
		PieChart piechart = new PieChart(categoryseries, defaultrenderer);
		return new GraphicalView(context, piechart);
	}

	public static final GraphicalView getDialChartView(Context context,
			CategorySeries categoryseries, DialRenderer dialrenderer) {
		checkParameters(categoryseries, dialrenderer);
		DialChart dialchart = new DialChart(categoryseries, dialrenderer);
		return new GraphicalView(context, dialchart);
	}

	public static final GraphicalView getDoughnutChartView(Context context,
			MultipleCategorySeries multiplecategoryseries,
			DefaultRenderer defaultrenderer) {
		checkParameters(multiplecategoryseries, defaultrenderer);
		DoughnutChart doughnutchart = new DoughnutChart(multiplecategoryseries,
				defaultrenderer);
		return new GraphicalView(context, doughnutchart);
	}

	public static final Intent getLineChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		return getLineChartIntent(context, xymultipleseriesdataset,
				xymultipleseriesrenderer, "");
	}

	public static final Intent getScatterChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		return getScatterChartIntent(context, xymultipleseriesdataset,
				xymultipleseriesrenderer, "");
	}

	public static final Intent getBubbleChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		return getBubbleChartIntent(context, xymultipleseriesdataset,
				xymultipleseriesrenderer, "");
	}

	public static final Intent getTimeChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer, String s) {
		return getTimeChartIntent(context, xymultipleseriesdataset,
				xymultipleseriesrenderer, s, "");
	}

	public static final Intent getBarChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer,
			org.achartengine.chart.BarChart.Type type) {
		return getBarChartIntent(context, xymultipleseriesdataset,
				xymultipleseriesrenderer, type, "");
	}

	public static final Intent getLineChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer, String s) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		LineChart linechart = new LineChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		intent.putExtra("chart", linechart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getScatterChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer, String s) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		ScatterChart scatterchart = new ScatterChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		intent.putExtra("chart", scatterchart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getBubbleChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer, String s) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		BubbleChart bubblechart = new BubbleChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		intent.putExtra("chart", bubblechart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getTimeChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer, String s,
			String s1) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		TimeChart timechart = new TimeChart(xymultipleseriesdataset,
				xymultipleseriesrenderer);
		timechart.setDateFormat(s);
		intent.putExtra("chart", timechart);
		intent.putExtra("title", s1);
		return intent;
	}

	public static final Intent getBarChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer,
			org.achartengine.chart.BarChart.Type type, String s) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		BarChart barchart = new BarChart(xymultipleseriesdataset,
				xymultipleseriesrenderer, type);
		intent.putExtra("chart", barchart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getRangeBarChartIntent(Context context,
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer,
			org.achartengine.chart.BarChart.Type type, String s) {
		checkParameters(xymultipleseriesdataset, xymultipleseriesrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		RangeBarChart rangebarchart = new RangeBarChart(
				xymultipleseriesdataset, xymultipleseriesrenderer, type);
		intent.putExtra("chart", rangebarchart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getPieChartIntent(Context context,
			CategorySeries categoryseries, DefaultRenderer defaultrenderer,
			String s) {
		checkParameters(categoryseries, defaultrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		PieChart piechart = new PieChart(categoryseries, defaultrenderer);
		intent.putExtra("chart", piechart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getDoughnutChartIntent(Context context,
			MultipleCategorySeries multiplecategoryseries,
			DefaultRenderer defaultrenderer, String s) {
		checkParameters(multiplecategoryseries, defaultrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		DoughnutChart doughnutchart = new DoughnutChart(multiplecategoryseries,
				defaultrenderer);
		intent.putExtra("chart", doughnutchart);
		intent.putExtra("title", s);
		return intent;
	}

	public static final Intent getDialChartIntent(Context context,
			CategorySeries categoryseries, DialRenderer dialrenderer, String s) {
		checkParameters(categoryseries, dialrenderer);
		Intent intent = new Intent(context, GraphicalActivity.class);
		DialChart dialchart = new DialChart(categoryseries, dialrenderer);
		intent.putExtra("chart", dialchart);
		intent.putExtra("title", s);
		return intent;
	}

	private static void checkParameters(
			XYMultipleSeriesDataset xymultipleseriesdataset,
			XYMultipleSeriesRenderer xymultipleseriesrenderer) {
		if (xymultipleseriesdataset == null
				|| xymultipleseriesrenderer == null
				|| xymultipleseriesdataset.getSeriesCount() != xymultipleseriesrenderer
						.getSeriesRendererCount())
			throw new IllegalArgumentException(
					"Dataset and renderer should be not null and should have the same number of series");
		else
			return;
	}

	private static void checkParameters(CategorySeries categoryseries,
			DefaultRenderer defaultrenderer) {
		if (categoryseries == null
				|| defaultrenderer == null
				|| categoryseries.getItemCount() != defaultrenderer
						.getSeriesRendererCount())
			throw new IllegalArgumentException(
					"Dataset and renderer should be not null and the dataset number of items should be equal to the number of series renderers");
		else
			return;
	}

	private static void checkParameters(
			MultipleCategorySeries multiplecategoryseries,
			DefaultRenderer defaultrenderer) {
		if (multiplecategoryseries == null
				|| defaultrenderer == null
				|| !checkMultipleSeriesItems(multiplecategoryseries,
						defaultrenderer.getSeriesRendererCount()))
			throw new IllegalArgumentException(
					"Titles and values should be not null and the dataset number of items should be equal to the number of series renderers");
		else
			return;
	}

	private static boolean checkMultipleSeriesItems(
			MultipleCategorySeries multiplecategoryseries, int i) {
		int j = multiplecategoryseries.getCategoriesCount();
		boolean flag = true;
		for (int k = 0; k < j && flag; k++)
			flag = multiplecategoryseries.getValues(k).length == multiplecategoryseries
					.getTitles(k).length;

		return flag;
	}

	public static final String CHART = "chart";
	public static final String TITLE = "title";
}


/*
	DECOMPILATION REPORT

	Decompiled from: C:\Users\chenzhigen\Desktop\android\StaticChartDemo\lib\achartengine-0.6.0.jar
	Total time: 15 ms
	Jad reported messages/errors:
	Exit status: 0
	Caught exceptions:
*/